package com.sys.plat.ExtDirect;

import com.sys.plat.web.core.ActionContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * Created by IntelliJ IDEA.
 * User: mabo
 * Date: 2010-3-16
 * Time: 14:20:41
 * To change this template use File | Settings | File Templates.
 */
public class ExtDirectBaseAction {

	public static Object getService(String beanId){
		WebApplicationContext webApplicationContext = getWebApplicationContext();
		return webApplicationContext.getBean(beanId);
	}

	public static WebApplicationContext  getWebApplicationContext() {
        return WebApplicationContextUtils.getWebApplicationContext(ActionContext.getRequest().getSession().getServletContext());
    }

}
